package cn.elwy.rcp.ui.provider;

import org.eclipse.jface.viewers.ICheckStateProvider;

/**
 * 选择状态提供者
 * 
 * @author huangsq
 * @version 1.0, 2014-06-23
 * @since 1.0, 2014-06-23
 */
public class DataCheckStateProvider implements ICheckStateProvider {

  private DataParser parser;

  public DataCheckStateProvider(DataParser parser) {
    this.parser = parser;
  }

  @Override
  public boolean isChecked(Object element) {
    return parser.isChecked(element);
  }

  @Override
  public boolean isGrayed(Object element) {
    return parser.isGrayed(element);
  }

  public void setParser(DataParser parser) {
    this.parser = parser;
  }

  public DataParser getParser() {
    return parser;
  }

}
